<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

//箭头函数中 没有 argments
        let sum = (...args)=>{
            let count = 0;
            args.forEach(item => count += item)
            return count
        }
        console.log('sum(10,20,30) :>> ', sum(10,20,30));
        console.log('sum(10,20,30,40) :>> ', sum(10,20,30,40));
    

    console.log("扩展运算符");

    let arg = [1,2,3];
    console.log('...arg :>> ', ...arg);

    let ary1 = [1,2,3,4];
    let ary2 = [1,2,3,47];
    let ary3 = [...ary1,...ary2]
    console.log('...ary1,...ary2 :>> ', ...ary1,...ary2);
    console.log('ary3 :>> ', ary3);
    </script>
</body>
</html>